let i = 0;
const timeCount = () => {
  i = i + 1;
  postMessage(i);
  setTimeout(timeCount, 500);
};

timeCount();
